function focusOnInput(el) {
	el.input.focus();
}

function escapeSpecialCharacters(id) {
	return '#' + id.replace(/(:|\.)/g, '\\\$1');
}

/**
 * This function support for Inplace Primefaces component.<br/> Detect the
 * action keypress. Perform click button 'save' if user press Enter, or click
 * button 'cancel' if user press Esc.<br/><br/>
 * 
 * Warning: if Inplace component inside the form. When user press Enter, the
 * default command button in the form also called.
 * 
 * @param event
 *            keypress event
 * @param inplaceEditorElement
 *            the input element of Inplace component
 */
function onKeypressInplace(event, inplaceInputElement) {
	if (event.keyCode == 13 || event.keyCode == 27) {
		$(inplaceEditorElement).parent().find(event.keyCode == 13 ? '.ui-inplace-save' : '.ui-inplace-cancel').first()
				.click();
		return false;
	}
}